package com.day13.ex05;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ExceptionDemo {
    public static void main(String[] args) {
        System.out.println("main方法开始");
        try{
            method2();
        }catch (ParseException e){
            e.printStackTrace();
        }
        System.out.println("main方法结束");
    }
    public static void method2()throws ParseException{
        String s="2020-09-09";
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        Date date=sdf.parse(s);
        System.out.println(date);
    }
    public static void method() throws ArrayIndexOutOfBoundsException{
        int[]arr={1,2,3};
        System.out.println(arr[3]);
    }
}
